using UnityEngine;
using UnityEngine.Rendering;
public class fixcamera : MonoBehaviour
{
	private void OnEnable()
	{	
		RenderPipelineManager.beginCameraRendering += OnBeginCameraRendering;
		RenderPipelineManager.endCameraRendering += OnEndCameraRendering;
	}
	private void OnDisable()
	{
		RenderPipelineManager.beginCameraRendering -= OnBeginCameraRendering;
		RenderPipelineManager.endCameraRendering -= OnEndCameraRendering;
	}
	private static void OnBeginCameraRendering(ScriptableRenderContext ctx, Camera cam)
	{
		cam.cullingMatrix = Matrix4x4.Ortho(-99, 99, -99, 99, 0.001f, 99)*cam.worldToCameraMatrix;
	}
	private static void OnEndCameraRendering(ScriptableRenderContext ctx, Camera cam)
	{
		cam.ResetCullingMatrix();
	}
}